{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">
                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="key" class="layui-input search" name="key" value="" placeholder="商品名"/>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn layui-btn-primary" onclick="history.go(-1)" >返回</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--图片模板-->
                    <script type="text/html" id="imgTpl">
                        <ul class="img_view">
                            {{# if(d.oi_goods_image.length > 0){ }}
                            <li><img src="{{d.oi_goods_image[0]}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"/></li>
                            {{# if(d.oi_goods_image.length >= 1){ }}
                            {{# for(var i=1;i<d.oi_goods_image.length;i++){  }}
                            <li style="display:none;"><img src="{{d.oi_goods_image[i]}}" ></li>
                            {{# } }}
                            {{# } }}
                            {{# } }}
                        </ul>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Order/orderInfo")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'oi_goods_name', width: '', title: '商品名', align: 'center'}
                , {field: 'oi_goods_image', width: '', title: '图片', align: 'center', templet: '#imgTpl'}
                , {field: 'oi_goods_price', width: '', title: '现金价', align: 'center'}
                , {field: 'oi_goods_jifen', width: '', title: '积分价', align: 'center'}
                , {field: 'oi_goods_model', width: '', title: '规格', align: 'center'}
                , {field: 'oi_num', width: '', title: '数量', align: 'center'}
            ]],
            done: function (res, curr, count) {
                $('.img_view').viewer();
            }
        });
    });
</script>
</body>
</html>